<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!--  scriptList start -->
<script type="text/javascript" src="../js/jquery-1.7.1.js"></script>

<script type="text/javascript">
$(document).ready(function(){


	 $("#cancel").click(function(){  
		 
			 
	 	window.location.href="aboutus.php";
			 
	 })
});
</script>
<title>关于我们信息</title>
<base target="_self">
<link rel="stylesheet" type="text/css" href="../css/admin/base.css" />
<link rel="stylesheet" type="text/css" href="../css/admin/main.css" />
<style type="text/css">
tr{
	height:40px;
}
input{
	width:500px; 
	background:url(../images/admin/inputbg.gif) repeat-x; 
	border:solid 1px #d1d1d1; 
	font-size:9pt; 
	font-family:Verdana, Geneva, sans-serif;
	
}
</style>
</head>
<body leftmargin="8" topmargin='8'>
<?php


	$id=$_GET['id'];
	$type=$_GET['type'];

	if($type == "update"){
		require_once("../conn.php"); 
		$sql = "select * from t_intro where id=".$id;
		$rs = mysql_query($sql);
		while($row=mysql_fetch_array($rs)){
			$encode="utf-8";
			$infotitle=$row["typeIntro"];
			$infocontent=$row["contentIntro"];
		}
	}


	if ($_POST['Submit']!="")
	{

		$id=$_POST['id'];
		$title = $_POST['title'];
		$content = $_POST['content'];
		$type =  $_POST['type'];
		/* echo "<script language='javascript'> alert('$title');</script>";
		echo "<script language='javascript'> alert('$content');</script>"; 
		echo "<script language='javascript'> alert('$type');</script>"; */

		if($type == "update"){
			require_once("../conn.php"); 
			$sql="update t_intro set contentIntro = '".$content."' where id = ".$id;

			/* echo "<script language='javascript'> alert('$sql');</script>"; */
 			mysql_query($sql);

			echo "<script language='javascript'>alert('修改成功!');window.location.href='aboutus.php';</script>";
		}elseif($type == "insert"){

			require_once("../conn.php"); 
			$sql="insert into  (title,date,content) values( '".$title."' , '".$date."' , '".$content."') ";
			/*echo "<script language='javascript'> alert('$sql');</script>"; */
 			mysql_query($sql);
			/*echo mysql_error();*/
			echo "<script language='javascript'>alert('新增成功!');window.location.href='archives.php';</script>";


		}

	}
						
?>
<form name="form1" method="post" action="aboutusedit.php"> 

<table width="98%" align="center" border="0" cellpadding="4" cellspacing="1" bgcolor="#CBD8AC" style="margin-bottom:8px">
  <tr bgcolor="#EEF4EA">
    <td colspan="2" background="../images/admin/wbg.gif" class='title'><span>关于我们信息</span></td>
  </tr>
  <tr bgcolor="#FFFFFF" style="display:none;">
    <td width="25%" bgcolor="#FFFFFF">
    <?php
		 echo "<input type='text' name='type' id='type' value='".$type."'></input>";
	?>
	</td>
    <td width="75%" bgcolor="#FFFFFF">
    <?php
		 echo "<input type='text' name='id' id='id' value='".$id."'></input>";
	?>
	</td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td width="25%" bgcolor="#FFFFFF">信息标题：</td>
    <td width="75%" bgcolor="#FFFFFF">
    <?php
		 echo "<input type='text' name='title' id='title' value='".$infotitle."' readonly='readonly'' ></input>";
	?>
	</td>
  </tr>
   <tr>
          <td><div align="right">内容</div></td>
          <td><input type="hidden" id="content" name="content" style="display:none" value="<?php echo(htmlspecialchars ($infocontent));?>" />
          <input type="hidden" id="FCKeditor1___Config" value="" style="display:none" />
          <iframe id="FCKeditor1___Frame" src="../fckeditor/editor/fckeditor.html?InstanceName=content&amp;Toolbar=Default" width="700" height="300" frameborder="0" scrolling="no"></iframe></td>
        </tr>
  
  <tr bgcolor="#FFFFFF">
  <td>
  	
	
  </td>
  <td>
  	<input type="submit" name="Submit" id="Submit" value="提交" style="width:50px;"> 
  	<input type="button" name="Cancel" id="cancel" value="返回" style="width:50px;"> 
  </td>
  </tr>
</table>
</form>
</body>
</html>